home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / AIncludes / PowerEqu.a < prev    next >
Encoding:
Text File  |  1989-10-13  |  3.2 KB  |  174 lines  |  [TEXT/MPS ]

  1. ; Version: 2.87
  2. ; Created: Wednesday, September 27, 1989 at 7:04:54 AM
  3. ;
  4. ;      PowerEqu.a
  5. ;      Assembler Interface to the Macintosh Libraries
  6. ;
  7. ;      Copyright Apple Computer, Inc.  1989
  8. ;      All rights reserved
  9. ;
  10.  
  11.  
  12. ; bit positions for PowerClockByte
  13. pmSCCBit        EQU         1                        ;SCC clock
  14. pmModemBit        EQU         3                        ;Internal modem power
  15. pmSerialBit     EQU         4                        ;Serial drivers power
  16. pmVoltBit        EQU         6                        ;-5 volt power
  17. pmDevEnableBit    EQU         7
  18.  
  19. ; Masks for PowerClockByte
  20. pmSCCMask        EQU         $2
  21. pmModemMask     EQU         $8
  22. pmSerialMask    EQU         $10
  23. pmVoltMask        EQU         $40
  24. pmDevEnableMask   EQU        $80
  25.  
  26. ; Bit Positions for ModemByte
  27. modemOnBit        EQU         0
  28. ringWakeUpBit    EQU         2
  29. modemInstalledBit EQU        3
  30. ringDetectBit    EQU         4
  31. modemOnHookBit    EQU         5
  32.  
  33. ; masks for ModemByte
  34. modemOnMask     EQU         $1
  35. ringWakeUpMask    EQU         $4
  36. modemInstalledMask EQU        $8
  37. ringDetectMask    EQU         $10
  38. modemOnHookMask   EQU        $20
  39.  
  40. ; bit positions for BatteryByte
  41. chargerConnBit    EQU         0
  42. hiChargeBit     EQU         1
  43. chargeOverFlowBit EQU        2
  44. batteryDeadBit    EQU         3
  45. batteryLowBit    EQU         4
  46. connChangedBit    EQU         5
  47.  
  48. ; masks for BatteryByte
  49. chargerConnMask   EQU        $1
  50. hiChargeMask    EQU         $2
  51. chargeOverFlowMask EQU        $4
  52. batteryDeadMask   EQU        $8
  53. batteryLowMask    EQU         $10
  54. connChangedMask   EQU        $20
  55.  
  56. ; Commands for Power Manager parameter block
  57. powerCntl        EQU         $10                     ; Power/clock control
  58. powerRead        EQU         $18                     ; Power/clock control
  59. modemRead        EQU         $58                     ; Internal modem setup
  60. batteryRead     EQU         $68                     ; Battery/charger level and status
  61. setWakeUp        EQU         $80                     ; Set Wake-up timer
  62. disableWakeUp    EQU         $82                     ; Disable Wake-Up timer
  63. readWakeUp        EQU         $88                     ; Read Wake-Up timer
  64.  
  65. ; commands to SleepQRec sleepQProc
  66. sleepRequest    EQU         1                        ; sleep request
  67. sleepDemand     EQU         2                        ; sleep demand
  68. sleepWakeUp     EQU         3                        ; wake up
  69.  
  70. ;SleepQRec - sleepQFlags
  71. noCalls         EQU         1                        ; no need to call
  72. noRequest        EQU         2                        ; no need to send sleep request
  73.  
  74. ; Power Manager Data Structures
  75. PMParamBlock    RECORD        0
  76. pmCommand        DS.W        1
  77. pmCount         DS.W        1
  78. pmSendBuff        DS.L        1
  79. pmReceiveBuff    DS.L        1
  80. pmPrmBlkSize    EQU         *                        ; size of PMParamBlock Record
  81.                 ENDR
  82.  
  83. SleepQRec        RECORD        0
  84. sleepQLink        DS.L        1
  85. sleepQType        DS.W        1
  86. sleepQProc        DS.L        1
  87. sleepQFlags     DS.W        1
  88. sleepQRecSize    EQU         *                        ; size of SleepQRec Record
  89.                 ENDR
  90.  
  91.                                                         ; selectors for _IdleState trap
  92. getCPUSpeed     EQU         -1
  93. enableIdle        EQU         0
  94. disableIdle     EQU         1
  95.  
  96.                                                         ; macros for _IdleState trap
  97.                 MACRO
  98.                 _GetCPUSpeed
  99.                 move.l        #getCPUSpeed,D0
  100.                 DC.W        $A485
  101.                 ENDM
  102.  
  103.  
  104.                 MACRO
  105.                 _EnableIdle
  106.                 move.l        #enableIdle,D0
  107.                 DC.W        $A485
  108.                 ENDM
  109.  
  110.  
  111.                 MACRO
  112.                 _DisableIdle
  113.                 move.l        #disableIdle,D0
  114.                 DC.W        $A485
  115.                 ENDM
  116.  
  117.  
  118. ; selectors for _SerialPowerTrap
  119. aOn             EQU         $4
  120. aOnIgnoreModem    EQU         $5
  121. bOn             EQU         $0
  122. bOnIgnoreModem    EQU         $1
  123. aOff            EQU         $84
  124. bOff            EQU         $80
  125.  
  126.                                                         ; macros for _SerialPowerTrap
  127.                 MACRO
  128.                 _AOn
  129.                 move.l        #aOn,D0
  130.                 DC.W        $A685
  131.                 ENDM
  132.  
  133.  
  134.  
  135.                 MACRO
  136.                 _AOnIgnoreModem
  137.                 move.l        #aOnIgnoreModem,D0
  138.                 DC.W        $A685
  139.                 ENDM
  140.  
  141.  
  142.  
  143.                 MACRO
  144.                 _BOn
  145.                 move.l        #bOn,D0
  146.                 DC.W        $A685
  147.                 ENDM
  148.  
  149.  
  150.  
  151.                 MACRO
  152.                 _BOnIgnoreModem
  153.                 move.l        #bOnIgnoreModem,D0
  154.                 DC.W        $A685
  155.                 ENDM
  156.  
  157.  
  158.  
  159.                 MACRO
  160.                 _AOff
  161.                 move.l        #aOff,D0
  162.                 DC.W        $A685
  163.                 ENDM
  164.  
  165.  
  166.  
  167.                 MACRO
  168.                 _BOff
  169.                 move.l        #bOff,D0
  170.                 DC.W        $A685
  171.                 ENDM
  172.  
  173.  
  174.